package com.hyh.web;

import com.hyh.bean.Grade;
import com.hyh.dao.impl.GradeDaoImpl;
import com.hyh.service.GradeService;
import com.hyh.service.impl.GradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/Educational/student/getGradeList")
public class GradeListServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //
        GradeService service = new GradeServiceImpl();
        List<Grade> serviceList = service.getList();
        req.setAttribute("gradelist",serviceList);
        req.getRequestDispatcher("add.jsp").forward(req,resp);
    }
}
